function Y = sub2full(X, P, T)


[D q] = size(P);
N = numel(X)/q;

% X = reshape(X, q, N);
Y = P*X + T*ones(1, N);
